Image processing device and image processing program for producing layout image including plural selected images

ABSTRACT

When an image processing program runs on a PC to produce a layout image in which plural selected images are inserted separately into image display frames, a CPU functions as a browser controller, a face image counter, an average number calculator, a pattern selector, a table, and an image layout section. The face image counter counts face images in each selected image. The average number calculator calculates an average number of the face images in a single selected image. Plural layout patterns of the image display frames are established in the table, which also defines the number of the image display frames and a threshold number of the face images for each layout pattern. Comparing the average number with the threshold number, the pattern selector selects the layout pattern. The image layout section inserts the selected images into the image display frames in the selected layout pattern.

FIELD OF THE INVENTION

The present invention relates to image processing device and program forproducing a layout image in which plural selected images are separatelyinserted into image display frames.

BACKGROUND OF THE INVENTION

There is a practical technology to detect a face of a photographedperson in a digital image taken with a digital camera. This technologyis utilized for other image processes, such as changing the brightnessof an image to show the face with optimum brightness, and trimming theperiphery of the face (hereinafter, face area) to display it in fullscreen.

The information (position, etc) of the detected face area can be stored,together with the shooting date and such, as accompanying informationassociated with the digital image. Accordingly, by equipping an imageprocessing device or an image viewer with such a face area detectingfunction, it is possible to provide high added-value services using theinformation of the face area. Here, the image viewer is an imageprocessing software for displaying (the list or the selection of theimages) and editing (copy, delete, trim, rotate and resize) the images,and sometimes has a function to produce a layout image which containsplural selected images inserted into image display frames.

For example, Japanese patent laid-open publication No. 2004-178163discloses an image processing device which detects the face area of aphotographed person in image data and combines a preset decorativeimage, such as a hat or an eyeglass, of appropriate size and positionwith the person.

Also, Japanese patent laid-open publication No. 2004-207987 discloses aprint system including a digital camera that detects a face area fromthe image data, and a memory to store the position and size informationof the face area. Based on this information, the photographed person isprinted, on the printer, with an appropriate position and size.

Further, Japanese patent laid-open publication No. 2002-042116 disclosesan image processing device which retrieves image data of severalpersons, and adjusts these data such that every face has approximatelythe same size.

The image data thus adjusted is suitable for making a portrait list orsuch a layout image to list portraits. However, if a group photographcontaining several persons is used in a typical layout image whose imagedisplay frames usually have the same size, each person may sometimes betoo small to see. In this case, the user takes trouble to adjust each ofthe images and insert them into the image display frames.

SUMMARY OF THE INVENTION

In view of the foregoing, a primary object of the present invention isto provide an image processing device and an image processing program toproduce a layout image in which photographed people in selected imagesare easily viewed.

In order to achieve the above and other objects, an image processingdevice according to the present invention includes a memory, an averagenumber calculator, and a pattern selector so as to produce a layoutimage in which plural selected images are inserted separately into imagedisplay frames. The memory stores plural layout patterns with differentnumbers of image display frames. These image display frames get largeras the number of the image display frames decreases. The average numbercalculator detects and counts face images of photographed people in eachselected image, and then calculates an average number of the faceimages. The pattern selector selects one of the layout patterns based onthis average number, such that the face images do not become too smallin the layout image.

The memory also stores a threshold number of the face images for eachlayout pattern. The threshold number is a proper number of the faceimages to be displayed in one image display frame. The pattern selectorcompares the threshold number with the average number when selecting thelayout pattern.

It is preferred that the layout pattern with the fewest number of theimage display frames is set as a default pattern. In this case, thepattern selector selects this default pattern, regardless of the averagenumber, when the number of the selected images is less than the fewestnumber. Also in this case, when the number of the selected images ismore than the fewest number, the average number calculator extracts asmany selected images as the fewest number and calculates an averagenumber of the face images.

The memory further stores the numbers of the image display frames invertical and horizontal directions of the layout image for each layoutpattern. It is preferred for the average number calculator to detect theface image by finding both eyes of each photographed person in theselected image. It may also be possible to provide the image processingdevice with an output unit for outputting the layout image to a monitordevice or a printer.

An image processing device according to another preferred embodiment ofthe present invention includes a face image counter, an imageidentifying unit, and an image layout unit. The face image counterdetects and counts face images of photographed people in each selectedimage. The image identifying unit identifies the selected image with themost number of the face images. The image layout unit inserts theidentified selected image into an enlarged display frame, and does theother selected images in normal display frames. The enlarged displayframe is larger than the normal display frame, and enlarges the imageinserted.

It is preferred, when more than one selected image is identified, thatthe image identifying unit measures the sizes of the face images in eachidentified selected image, and then identifies the selected image withthe smallest total size of the face images. It is also preferred for theface image counter to detect the face image by finding both eyes of eachphotographed person in the selected image.

An image processing program according to the present invention directs apersonal computer to execute an average number calculating step and apattern selecting step so as to produce the layout image. In the averagenumber calculating step, the face images of photographed people aredetected and counted for each selected image, and then an average numberof the face images is calculated. In the pattern selecting step, one ofplural layout patterns of the image display frames is selected based onthe average number, such that the face images do not become too small inthe layout image. These layout patterns are stored in a memory, and havedifferent numbers of the image display frames. The image display framesget larger as the number of the image display frames decreases.

The memory also stores a threshold number of the face images for eachlayout pattern. The threshold number is a proper number of the faceimages to be displayed in one image display frame, and compared with theaverage number in the pattern selecting step.

It is preferred that the layout pattern with the fewest number of theimage display frames is set as a default pattern. In this case, thedefault pattern is selected in the pattern selecting step, regardless ofsaid average number, when the number of the selected images is less thanthe fewest number. Also in this case, when the number of the selectedimages is more than the fewest number, as many selected images as thefewest number are extracted, and an average number of the face images iscalculated in the average number calculating step.

The memory further stores the numbers of the image display frames invertical and horizontal directions of said layout image for each layoutpattern. In the average number calculating step, the face image ispreferably detected by finding both eyes of each photographed person inthe selected image. It may also be possible to provide an imageoutputting step for outputting the layout image to a monitor device or aprinter.

An image processing program according to another preferred embodiment ofthe present invention directs a personal computer to execute a countingstep, an identifying step, and an inserting step. In the counting step,face images of photographed people are detected and counted for eachselected image. In the identifying step, the selected image with themost number of the face images is identified. In the inserting step, theidentified selected image is inserted into an enlarged display frame,and the other selected images are inserted into normal display frames.The enlarged display frame is larger than the normal display frame, andenlarges the image inserted.

It is preferred, when more than one selected image is identified, thatthe sizes of the face images are measured for each identified selectedimage, and the selected image with the smallest total size of the faceimages is identified.

According to the present invention, the layout pattern of the imagedisplay frames is changed depending on the number of people's faces inthe selected images. The layout image thus produced can be displayed infull screen, and also be printed as an index print on an externalprinter.

Additionally, a group picture and such a picture with many people aredisposed separately from other pictures in the layout image, andtherefore the people of each picture are easily viewed in the layoutimage.

BRIEF DESCRIPTION OF THE DRAWINGS

The above objects and advantages of the present invention will becomemore apparent from the following detailed description when read inconnection with the accompanying drawings, in which:

FIG. 1 is a block diagram of an image processing device according to afirst embodiment of the present invention;

FIG. 2 is an explanatory view of an image display browser window;

FIG. 3 is an explanatory view of a face area;

FIG. 4A and FIG. 4B are explanatory views of layout images;

FIG. 5 is a flow chart of image processing procedure;

FIG. 6 is a block diagram of an image processing device according to asecond embodiment of the present invention;

FIG. 7 is an explanatory view of an image display browser windowaccording to the second embodiment; and

FIG. 8 is a flow chart of image processing procedure according to thesecond embodiment.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

Referring to FIG. 1, a personal computer (hereinafter, PC) 1 iscontrolled by a CPU 10. Connected to this CPU 10 are a memory 3, amonitor 4, an operating section 5, and two communication interfaces(I/F) 6 and 8.

The memory 3 includes a semiconductor memory and/or a magnetic disc, andstores an image processing program 2 as well as other various programsand data to start the PC 1. Also, the memory 3 will store image data(both still images and movies) transferred from a digital camera 7through the communication I/F 6.

The monitor 4 has an LCD or CRT screen to display the image data andvarious information. The operating section 5 includes a keyboard 5 a anda mouse 5 b. Responding to the manipulation of the operating section 5,the CPU 10 controls the operation of the PC 1. The communication I/F 6is a USB interface or such a general interface to be connected through aUSB cable to the digital camera 7 and an external device for datatransmission. The communication I/F 8, on the other hand, is an RS232Cinterface, a LAN (Local Area Network) interface, or such a generalinterface to be connected thorough a serial cable or a LAN cable to aprinter 9 and an external device for data transmission.

When the image processing program 2 runs on the PC 1, the CPU 10generates a browser controller 12, a face image counter 13, an imagelayout section 16, an average number calculator 17, a pattern selector14, and a table 18. Also, the CPU 10 generates a printer driver 11 and amonitor driver 15. The browser controller 12 generates and controls animage display browser 20 displayed as a GUI (Graphic User Interface) onthe monitor 4.

As shown in FIG. 2, the image display browser 20 is composed of anexplorer window 20 a to help finding a desired folder 21, a thumbnailwindow 20 b to display thumbnail images 22 in the folder 21, a selectedimage window 20 c to display selected images 29, and a layout window 20d to display a later described layout image 26. Moving a cursor 28 to athumbnail image 22 and double clicking on the mouse 5 b will select thisthumbnail image 22 as the selected image 29, which is then displayed inthe selected image window 20 c. A current total of the selected images29 is shown on a image number indicator 23. The selected images 29 arelarger than the thumbnail images 22, and displayed in the selected imagewindow 20 c in the same order as selected. It is, however, possible tosort the selected images 29 by date or to drag and drop them for adesired sequence.

The cursor 28 indicates the position of the mouse 5 b in the imagedisplay browser 20, and moves in response to the mouse 5 b. Each of thewindows 20 a to 20 c has two scroll bars 27 a to 27 f on the right andthe bottom. These scroll bars 27 a to 27 f are slid to scroll thewindows in the corresponding directions. Additionally, a menu bar 25that includes plural menu items is provided at an upper area of theimage display browser 20. Selecting a menu from the menu bar 25, theuser can perform various operations on image display browser 20, such assorting the selected images 29 by date in the selected image window 20c, displaying the layout image 26 in full screen, and printing thelayout image 26 on the printer 9. In the layout window 20 d, plurallayout images 26 are overlapped, and each layout image 26 has a page tab24 on the top. Moving the cursor 28 to a desired page tab 24 andclicking on the mouse 5 b leads the layout image 26 of selected page toappear in the layout window 20 d.

The layout image 26 is a synthetic image composed of plural imagedisplay frames 26 a and selected images 26 separately inserted therein.This layout image 26 can be, for example, an index image that displays alist of pictures. Each of the selected images 29 is diminished andinserted into the image display frames 26 a. The image display frames 26a can take several different layout patterns, one of which is selectedwhen the layout image 26 is produced.

Depending on the layout pattern selected, the size of the image displayframe 26 a and the number of the image display frames 26 a in the layoutimage 26 change. Since the size of the layout image 26 is fixedaccording to the print size or the stored size, the image display frames26 a will be small when the layout pattern with a lot of the imagedisplay frames 26 a is selected, and will be large when the layoutpattern with a few image display frames 26 a is selected.

Generally, the face of a person appears smaller in a picture withseveral persons than a picture with a single person, and the face isgetting even smaller as the number of people increases in a picture. Theface is easily viewed when it appears large, for sure, and it is thuspreferred to display the faces in the selected images 29 as large aspossible in the layout image 26. Accordingly, the layout pattern of theimage display frames 26 a is determined depending on the number ofpeople in the selected images 29 to be used. This process is nowdescribed below.

Referring back to FIG. 1, the face image counter 13 detects the faces ofpeople in the selected image 29, and counts the number of the faces(hereinafter, face number). The face image counter 13 detects a faceimage 30 by, for example as shown in FIG. 3, matching both eyes 31 a ofa detected person 31 in the selected image 29 with preset image data ofa typical person's eyes. The face image counter 13 conveys the number ofthe counted face images to the average number calculator 17. It is to benoted that the face image 30 may also be detected based on the relationof the eyes and the mouth, the outline of the face, or the skin color ofthe face.

The average number calculator 17 calculates an average number of theface images in a single selected image 29 by firstly summing up thenumber of the counted face images, and then dividing the sum by thenumber of the image display frames 26 a previously set in the table 18.The average number of the face images is sent to the pattern selector14.

The pattern selector 14 determines the layout pattern of the imagedisplay frames 26 a based on the average number of the face images and athreshold number of the face images set in the table 18. The table 18 iscomposed of, for example, layout patterns 1-3 (i), and their own numbers(Ki) of the image display frames 26 a, the columns and rows (Li×Mi) ofthe image display frames 26 a, and threshold numbers (THi) of the faceimages, as shown in TABLE 1 below. Among the layout patterns 1-3, thelayout pattern 1 contains the fewest number of the image display frames26 a (Ki), with 15 image display frames 26 a of the largest size. These15 image display frames are arranged in a 3 (columns)×5 (rows) matrix.The layout pattern 3 contains the most number of the image displayframes 26 a (Ki), with 40 image display frames 26 a of the smallestsize. These 40 image display frames are arranged in a 5 (columns)×8(rows) matrix. The layout pattern 2 is in the middle about the number(Ki) and the size of the image display frames 26 a, with 24 imagedisplay frames 26 a arranged in a 4 (columns)×6 (rows) matrix.

The threshold number (THi) of the face images is a favorable number ofthe face images in a single selected image 29, and predeterminedaccording to the size of the image display frame 26 a. If a selectedimage 29 with many face images is inserted into a relatively small imagedisplay frame 26 a such as of the layout pattern 3, each face image willbecome too small to see. If inserted into a relatively large imagedisplay frame 26 a such as of the layout pattern 1, to the contrary,this selected image 29 is less diminished than in the layout pattern 3,and each face image is kept relatively large even if the selected image29 has many face images.

In an initial state, the layout pattern 1 is selected and its number ofimage display frames (Ki), i.e., fifteen becomes the number of theselected images 29 to be used in the layout image 29. Accordingly, thepattern selector 14 extracts the forefront fifteen selected images 29from the selected image window 20 c. The face image counter 13 countsthe face images in these fifteen selected images 29. The average numbercalculator 17 divides the sum of the face images by the number of imagedisplay frames, or fifteen in this case, so as to calculate an averagenumber Av of the face images per a single selected image 29. The patternselector 14 firstly compares this calculated average number Av with thethreshold number (TH1=3) of the layout pattern 1, and then fixes thelayout pattern to 1 when the condition Av≧3 is satisfied. If the Av isless than 3, on the other hand, the pattern selector 14 selects thelayout pattern 2 from the table 18 and extracts the forefronttwenty-four selected images 29, the same number as K2, from the selectedimage window 20 c. The face image counter 13 counts the face images inthese twenty-four selected images 29. The pattern selector 14 fixes thelayout pattern to 2 when the Av is larger than or equal to the thresholdnumber (TH2=1) of the layout pattern 2. If the Av is less than 1, thepattern selector 14 selects the layout pattern 3. Since the layoutpattern 3 (imax) is set to contain the maximum number of image displayframes (K3=40) in this embodiment, the number of the face images is notconsidered when the layout pattern 3 is selected. Accordingly, thethreshold number TH3 is not provided. The number of the face images isalso not considered when the number of the selected images 29 is lessthan fifteen (K1), and in this case the layout pattern is fixed to 1.The fixed layout pattern is informed to the image layout section 16.

TABLE 1 THRESHOLD COLUMNS AND NUMBER LAYOUT NUMBER OF ROWS OF OF FACEPATTERN FRAMES* FRAMES* IMAGES (i) (Ki) (Li × Mi) (THi) 1 15 3 × 5 3 224 4 × 6 1 3 40 5 × 8 *image display frames

The image layout section 16 produces the layout image 26 by insertingthe selected images 29 into the image display frames 26 a in the fixedlayout pattern. The layout image 26 is displayed in the layout window 20d, and its image data is temporarily stored in the memory 3. This imagedata will be stored properly in the memory 3 when the user commands onthe operating section 5 to store the layout image 26. Alternatively, theimage data is deleted from the memory 3 when the user commands to deletethe layout image 26.

Next, the method for producing the layout image 26 is explained withreference to FIG. 4A and FIG. 4B. The layout images 26 in FIG. 4A areproduced from fifty selected images 29. As for the forefront fifteenselected images 29, the average number Av of the face images meets thecondition Av≧3 (TH1), and therefore the fifteen (K1) selected images 29are inserted into the image display frames 26 a in the 3×5 (L1×M1)layout to compose a page 1 layout image 26. The succeeding fifteenselected images 29 fail to meet the condition Av≧3 (TH1). Consequently,the layout pattern 2 is selected, and twenty-four selected images 29 areextracted. As for these twenty-four selected images 29, the averagenumber Av of the face images meets the condition Av≧1 (TH2) andtherefore the twenty-four (K2) selected images 29 are inserted into theimage display frames 26 a in the 4×6 (L2×M2) layout to compose a page 2layout image 26. Since there remain only ten selected images 29, a page3 layout image 26 contains the ten selected images 29 inserted into theimage display frames 26 a in the 3×5 (L1×M1) layout.

FIG. 4B shows the layout images 26 produced from 40 selected images 29.Here, while the forefront fifteen selected images 29 do not meet thecondition Av≧3 (TH1), the forefront twenty-four selected images do thecondition Av≧1 (TH2). Accordingly, a page 4 layout image 26 hastwenty-four (K2) image display frames 26 a in the 4×6 (L2×M2) layout.The succeeding fifteen selected images 29 do not meet the condition Av≧3(TH1), and the layout pattern 2 is thus selected. Since there remainonly sixteen selected images 29, Thi is not considered and the layoutpattern is fixed to 2 for a page 5 layout image 26, which therefore hastwenty-four (K2) image display frames 26 a in the 4×6 (L2×M2) layout.

The procedure for producing the layout image 26 is now explained withreference to FIG. 5. When the image display browser 20 is started anddisplayed on the monitor 4, the user selects one or more thumbnailimages 22 from the thumbnail window 20 b (st1) to display them as theselected images 29 in the selected image window 20 c. Then, a layoutfunction menu is selected from the menu bar 25, and the layout processis started (st2). If there is no selected image 29 at this time (st3),the user is directed to return to the image selecting step (st1). Ifthere is one or more selected images 29, a page number (p) is once setto 0 (st4) and then increased by 1, and the layout pattern i is set to 1(st5). The forefront Ki pieces of the selected images 29 are extractedfrom the selected image window 20 c. It is then judged that the numberof the selected images 29 extracted is Ki (st6), and the face images arecounted (st7). The average number Av is calculated by dividing the totalnumber of the face images by Ki (st8). When the condition Av≧Thi issatisfied (st9), the layout pattern is fixed to i, and a page p layoutimage 26 is produced by inserting the Ki pieces of the selected images29 into the image display frames 26 a in the Li×Mi layout (st12). Whenthe selected images 26 are less than Ki (st6), the page p layout image26 is produced with the layout pattern i (Li×Mi) currently selected(st12). When the condition Av≧Thi is not satisfied (st9), the layoutpattern i is increased by 1 (st10). If the last layout pattern (imax) isnot selected (st11), the procedure returns to the step 6. If the lastpattern (imax) is selected (st11), on the other hand, the page p layoutimage 26 is produced with the layout pattern imax (st12). The userrepeats the procedure from the step 5 until no selected image 29remains, and then completes the procedure (st13).

As described above, the number of the image display frames 26 a isdetermined optimally for the layout image 26 based on the number of theface images in the selected images 29. It is to be noted that the layoutpattern is not necessarily a matrix, and in this case there is no needto provide the vertical and horizontal numbers of the image layoutframes 26 a.

Next, with reference to FIG. 6 and FIG. 7, a second embodiment of thepresent invention is explained. In this second embodiment, thecomponents identical to those in the first embodiment are denoted by thesame reference numerals, and the detailed explanations thereof areomitted. The browser controller 12 controls an image display browser 40which is different from the image display browser 20 of the firstembodiment only in a layout image 35 in the layout window 20 d. Thelayout image 35 is composed of an enlarged display frame 35 a disposedin the center to enlarge the selected image 29 and plural normal displayframes 35 b around it. An image identifying section 19 identifies theselected image 29 with most face images, which is then inserted into theenlarged display frame 35 a. The remaining selected images 29 areinserted into the normal display frames 35 b. Additionally, the user canput a title 36 above the enlarged display frame 35 a.

The face image counter 13 counts the face images in every selected image29 in the selected image window 20 c, and conveys the number of thecounted face images to image identifying section 19. The identifyingsection 19 identifies the selected image 29 with most face images. Ifthere is more than one selected image 29 identified, in other words,more than one selected image 29 with the largest number of the faceimages 30, the image identifying section 19 further identifies one ofthese selected images 29 with the smallest total size of the face images30. The size of the face image 30 is measured by the method below.

As shown in FIG. 3, the both eyes 31 a of the person 31 is detected inevery selected image 29 during the count of the face images 30. Theimage identifying section 19 estimates, from an inter-eye distance S ofthe detected both eyes 31 a, a width W and a length L of the face, andidentifies the area defined by the width W and the length L as a facearea 32 (enclosed with dotted lines).

This estimation may be carried out by using, for example, the pre-storedinter-eye distance S_(A) and face width W_(A) of a typical person. Thewidth W is then calculated from the ratio to the inter-eye distance S(of the detected both eyes) expressed by the formula W=(S/S_(A))×W_(A).Similarly, the length L is calculated by using the inter-eye distanceS_(A) and the face length L_(A) of a typical person. The extent of theface area 32 measured from the face width W and the face length L isregarded as the size of the face image 30. It is to be noted that theface area 32 may also be identified based on the relation of the eyesand the mouth, the outline of the face, or the skin color of the face.

The image layout section 16 produces the layout image 35 by insertingthe selected image 29 identified by the image identifying section 19into the enlarged display frame 35 a and inserting the remainingselected images 29 into the normal display frames 35 b. If the number ofthe selected images 29 in the selected image window 20 c is more or lessthan the number of the image display frames (the enlarged display frame35 a+ the normal display frames 35 b) at this stage, an error message orsuch is provided to prompt the user to reselect the images.Alternatively, it may be possible to produce the layout image 35 withsome blank normal display frames 35 b when the selected images 29 areless than the image display frames. It may also be possible, when theselected images 29 are more than the image display frames, to extract asmuch selected images 29 as the image display frames automatically andproduce the layout image 35.

Referring to FIG. 8, the procedure for producing the layout image 35 isnow explained. When the image display browser 40 is started anddisplayed on the monitor 4, the user selects the thumbnail images 22 forthe layout image 35, and they are displayed as the selected images 29 inthe selected image window 20 c (st21). Then, a layout function menu isselected from the menu bar 25, and the layout process is started (st22).If the selected images 29 are more or less than the image display frames(st23), the user returns to the image selecting step (st21). When thenumber of the selected images 29 is identical to the number of the imageframes, the face images are counted in every selected image 29 (st24) toidentify the selected image 29 with most face images (st25). If there ismore than one selected image 29 identified (st26), Each face image inthese selected images 29 is measured (st27), and the selected image 29with the smallest total size of the face images is identified (st28).The selected image 29 thus identified is inserted into the enlargeddisplay frame 35 a (st29), while the remaining selected images 29 areinserted into the normal display frames 35 b (st30). In this embodiment,the selected images 29 are inserted successively in the clockwisedirection from the upper left corner of the layout image 35.

As describe above, the image having the largest number of people isenlarged in the enlarged display frame 35 a in the center of the layoutimage 35. It is possible, in the second embodiment, to provide more thanone enlarged display frame 35 a. It is also possible to prepare severalarrangement patterns for the normal display frames 35 b, so that thenormal display frames 35 b will have different sizes according to thenumber of the selected images 29 to be used.

Although the selected images 29 and the layout image 26 or 35 aredisplayed on the same screen in the above embodiments, it may bepossible to switch between, for example, a screen for the selectedimages 29 and a screen for the layout image 26 or 35.

The selected images 29 are selected by the cursor 28 moving along themouse 5 b in the above embodiments, the selected images 29 may howeverbe selected through an input device such as cursor keys of the keyboard5 a or a tablet (not shown).

While having been explained with the personal computer, the presentinvention is also applicable to various electronic devices, such asdigital still cameras, digital video cameras, photo-storages, PDAs, andmobile phones.

Although the present invention has been fully described by way of thepreferred embodiments thereof with reference to the accompanyingdrawings, various changes and modifications will be apparent to thosehaving skill in this field. Therefore, unless otherwise these changesand modifications depart from the scope of the present invention, theyshould be construed as included therein.

1. An image processing device for producing a layout image in whichplural selected images are inserted separately into image displayframes, said image processing device comprising: a memory storing plurallayout patterns with different numbers of said image display frames,said image display frames getting larger as said number of said imagedisplay frames decreasing; an average number calculator for detectingand counting face images of photographed people in said each selectedimage, and for calculating an average number of said face images; and apattern selector for selecting one of said layout patterns based on saidaverage number, such that said face images do not become too small insaid layout image.
 2. The image processing device of claim 1, whereinsaid memory stores a threshold number of said face images for each saidlayout pattern, said threshold number being a proper number of said faceimages to be displayed in one said image display frame, and wherein saidpattern selector compares said threshold number with said average numberwhen selecting said layout pattern.
 3. The image processing device ofclaim 1, wherein one said layout pattern with the fewest number of saidimage display frames is set as a default pattern, and wherein saidpattern selector selects said layout pattern with the fewest number ofsaid image display frames, regardless of said average number, when thenumber of said selected images is less than said fewest number.
 4. Theimage processing device of claim 3, wherein when the number of saidselected images is more than said fewest number, said average numbercalculator extracts as many said selected images as said fewest numberand calculates an average number of said face images.
 5. The imageprocessing device of claim 1, wherein the numbers of said image displayframes in vertical and horizontal directions of said layout image aredetermined for each said layout pattern.
 6. The image processing deviceof claim 1, wherein said average number calculator detects said faceimage by finding both eyes of each photographed person in said selectedimage.
 7. The image processing device of claim 1 further comprising: anoutput unit for outputting said layout image to a monitor device or aprinter.
 8. A non-transitory computer readable medium storing an imageprocessing program for producing a layout image in which plural selectedimages are inserted separately into image display frames, said imageprocessing program directing a computer to execute steps of: detectingand counting face images of photographed people in said each selectedimage, and calculating an average number of said face images; andselecting one of layout patterns of said image display frames based onsaid average number, such that said face images do not become too smallin said layout image, said layout patterns being stored in a memory andhaving different numbers of said image display frames, said imagedisplay frames getting larger as said number of said image displayframes decreasing.
 9. The image processing program of claim 8, whereinsaid memory stores a threshold number of said face images for each saidlayout pattern, said threshold number being a proper number of said faceimages to be displayed in one said image display frame, and beingcompared with said average number in said pattern selecting step. 10.The image processing program of claim 8, wherein one said layout patternwith the fewest number of said image display frames is set as a defaultpattern, and wherein said layout pattern with the fewest number of saidimage display frames is selected in said pattern selecting step,regardless of said average number, when the number of said selectedimages is less than said fewest number.
 11. The image processing programof claim 10, wherein when the number of said selected images is morethan said fewest number, as many said selected images as said fewestnumber are extracted, and an average number of said face images iscalculated in said average number calculating step.
 12. The imageprocessing program of claim 8, wherein the numbers of said image displayframes in vertical and horizontal directions of said layout image aredetermined for each said layout pattern.
 13. The image processingprogram of claim 8, wherein said face image is detected in said averagenumber calculating step by finding both eyes of each photographed personin said selected image.
 14. The image processing program of claim 8,further directing said computer to execute a step of: outputting saidlayout image to a monitor device or a printer.